home *** CD-ROM | disk | FTP | other *** search
/ Aminet 2 / Aminet AMIGA CDROM (1994)(Walnut Creek)[Feb 1994][W.O. 44790-1].iso / Aminet / dev / gcc / geninline_920614.lha / inline-2.0 / layers.h < prev    next >
C/C++ Source or Header  |  1992-06-14  |  15KB  |  462 lines

  1. #ifndef _INLINE_LAYERS_H
  2. #define _INLINE_LAYERS_H
  3.  
  4. #include <sys/cdefs.h>
  5. #include <inline/stubs.h>
  6.  
  7. __BEGIN_DECLS
  8.  
  9. #ifndef BASE_EXT_DECL
  10. #define BASE_EXT_DECL extern struct LayersBase*  LayersBase;
  11. #endif
  12. #ifndef BASE_PAR_DECL
  13. #define BASE_PAR_DECL
  14. #define BASE_PAR_DECL0 void
  15. #endif
  16. #ifndef BASE_NAME
  17. #define BASE_NAME LayersBase
  18. #endif
  19.  
  20. static __inline LONG 
  21. BeginUpdate (BASE_PAR_DECL struct Layer *l)
  22. {
  23.   BASE_EXT_DECL
  24.   register LONG  _res  __asm("d0");
  25.   register struct LayersBase* a6 __asm("a6") = BASE_NAME;
  26.   register struct Layer *a0 __asm("a0") = l;
  27.   __asm __volatile ("jsr a6@(-0x4e)"
  28.   : "=r" (_res)
  29.   : "r" (a6), "r" (a0)
  30.   : "a0","a1","d0","d1");
  31.   *(char *)a0 = *(char *)a0;
  32.   return _res;
  33. }
  34. static __inline LONG 
  35. BehindLayer (BASE_PAR_DECL long dummy,struct Layer *layer)
  36. {
  37.   BASE_EXT_DECL
  38.   register LONG  _res  __asm("d0");
  39.   register struct LayersBase* a6 __asm("a6") = BASE_NAME;
  40.   register long a0 __asm("a0") = dummy;
  41.   register struct Layer *a1 __asm("a1") = layer;
  42.   __asm __volatile ("jsr a6@(-0x36)"
  43.   : "=r" (_res)
  44.   : "r" (a6), "r" (a0), "r" (a1)
  45.   : "a0","a1","d0","d1");
  46.   *(char *)a0 = *(char *)a0;  *(char *)a1 = *(char *)a1;
  47.   return _res;
  48. }
  49. static __inline struct Layer *
  50. CreateBehindHookLayer (BASE_PAR_DECL struct Layer_Info *li,struct BitMap *bm,long x0,long y0,long x1,long y1,long flags,struct Hook *hook,struct BitMap *bm2)
  51. {
  52.   BASE_EXT_DECL
  53.   register struct Layer * _res  __asm("d0");
  54.   register struct LayersBase* a6 __asm("a6") = BASE_NAME;
  55.   register struct Layer_Info *a0 __asm("a0") = li;
  56.   register struct BitMap *a1 __asm("a1") = bm;
  57.   register long d0 __asm("d0") = x0;
  58.   register long d1 __asm("d1") = y0;
  59.   register long d2 __asm("d2") = x1;
  60.   register long d3 __asm("d3") = y1;
  61.   register long d4 __asm("d4") = flags;
  62.   register struct Hook *a3 __asm("a3") = hook;
  63.   register struct BitMap *a2 __asm("a2") = bm2;
  64.   __asm __volatile ("jsr a6@(-0xc0)"
  65.   : "=r" (_res)
  66.   : "r" (a6), "r" (a0), "r" (a1), "r" (d0), "r" (d1), "r" (d2), "r" (d3), "r" (d4), "r" (a3), "r" (a2)
  67.   : "a0","a1","a2","a3","d0","d1","d2","d3","d4");
  68.   *(char *)a0 = *(char *)a0;  *(char *)a1 = *(char *)a1;  *(char *)a3 = *(char *)a3;  *(char *)a2 = *(char *)a2;
  69.   return _res;
  70. }
  71. static __inline struct Layer *
  72. CreateBehindLayer (BASE_PAR_DECL struct Layer_Info *li,struct BitMap *bm,long x0,long y0,long x1,long y1,long flags,struct BitMap *bm2)
  73. {
  74.   BASE_EXT_DECL
  75.   register struct Layer * _res  __asm("d0");
  76.   register struct LayersBase* a6 __asm("a6") = BASE_NAME;
  77.   register struct Layer_Info *a0 __asm("a0") = li;
  78.   register struct BitMap *a1 __asm("a1") = bm;
  79.   register long d0 __asm("d0") = x0;
  80.   register long d1 __asm("d1") = y0;
  81.   register long d2 __asm("d2") = x1;
  82.   register long d3 __asm("d3") = y1;
  83.   register long d4 __asm("d4") = flags;
  84.   register struct BitMap *a2 __asm("a2") = bm2;
  85.   __asm __volatile ("jsr a6@(-0x2a)"
  86.   : "=r" (_res)
  87.   : "r" (a6), "r" (a0), "r" (a1), "r" (d0), "r" (d1), "r" (d2), "r" (d3), "r" (d4), "r" (a2)
  88.   : "a0","a1","a2","d0","d1","d2","d3","d4");
  89.   *(char *)a0 = *(char *)a0;  *(char *)a1 = *(char *)a1;  *(char *)a2 = *(char *)a2;
  90.   return _res;
  91. }
  92. static __inline struct Layer *
  93. CreateUpfrontHookLayer (BASE_PAR_DECL struct Layer_Info *li,struct BitMap *bm,long x0,long y0,long x1,long y1,long flags,struct Hook *hook,struct BitMap *bm2)
  94. {
  95.   BASE_EXT_DECL
  96.   register struct Layer * _res  __asm("d0");
  97.   register struct LayersBase* a6 __asm("a6") = BASE_NAME;
  98.   register struct Layer_Info *a0 __asm("a0") = li;
  99.   register struct BitMap *a1 __asm("a1") = bm;
  100.   register long d0 __asm("d0") = x0;
  101.   register long d1 __asm("d1") = y0;
  102.   register long d2 __asm("d2") = x1;
  103.   register long d3 __asm("d3") = y1;
  104.   register long d4 __asm("d4") = flags;
  105.   register struct Hook *a3 __asm("a3") = hook;
  106.   register struct BitMap *a2 __asm("a2") = bm2;
  107.   __asm __volatile ("jsr a6@(-0xba)"
  108.   : "=r" (_res)
  109.   : "r" (a6), "r" (a0), "r" (a1), "r" (d0), "r" (d1), "r" (d2), "r" (d3), "r" (d4), "r" (a3), "r" (a2)
  110.   : "a0","a1","a2","a3","d0","d1","d2","d3","d4");
  111.   *(char *)a0 = *(char *)a0;  *(char *)a1 = *(char *)a1;  *(char *)a3 = *(char *)a3;  *(char *)a2 = *(char *)a2;
  112.   return _res;
  113. }
  114. static __inline struct Layer *
  115. CreateUpfrontLayer (BASE_PAR_DECL struct Layer_Info *li,struct BitMap *bm,long x0,long y0,long x1,long y1,long flags,struct BitMap *bm2)
  116. {
  117.   BASE_EXT_DECL
  118.   register struct Layer * _res  __asm("d0");
  119.   register struct LayersBase* a6 __asm("a6") = BASE_NAME;
  120.   register struct Layer_Info *a0 __asm("a0") = li;
  121.   register struct BitMap *a1 __asm("a1") = bm;
  122.   register long d0 __asm("d0") = x0;
  123.   register long d1 __asm("d1") = y0;
  124.   register long d2 __asm("d2") = x1;
  125.   register long d3 __asm("d3") = y1;
  126.   register long d4 __asm("d4") = flags;
  127.   register struct BitMap *a2 __asm("a2") = bm2;
  128.   __asm __volatile ("jsr a6@(-0x24)"
  129.   : "=r" (_res)
  130.   : "r" (a6), "r" (a0), "r" (a1), "r" (d0), "r" (d1), "r" (d2), "r" (d3), "r" (d4), "r" (a2)
  131.   : "a0","a1","a2","d0","d1","d2","d3","d4");
  132.   *(char *)a0 = *(char *)a0;  *(char *)a1 = *(char *)a1;  *(char *)a2 = *(char *)a2;
  133.   return _res;
  134. }
  135. static __inline LONG 
  136. DeleteLayer (BASE_PAR_DECL long dummy,struct Layer *layer)
  137. {
  138.   BASE_EXT_DECL
  139.   register LONG  _res  __asm("d0");
  140.   register struct LayersBase* a6 __asm("a6") = BASE_NAME;
  141.   register long a0 __asm("a0") = dummy;
  142.   register struct Layer *a1 __asm("a1") = layer;
  143.   __asm __volatile ("jsr a6@(-0x5a)"
  144.   : "=r" (_res)
  145.   : "r" (a6), "r" (a0), "r" (a1)
  146.   : "a0","a1","d0","d1");
  147.   *(char *)a0 = *(char *)a0;  *(char *)a1 = *(char *)a1;
  148.   return _res;
  149. }
  150. static __inline void 
  151. DisposeLayerInfo (BASE_PAR_DECL struct Layer_Info *li)
  152. {
  153.   BASE_EXT_DECL
  154.   register struct LayersBase* a6 __asm("a6") = BASE_NAME;
  155.   register struct Layer_Info *a0 __asm("a0") = li;
  156.   __asm __volatile ("jsr a6@(-0x96)"
  157.   : /* no output */
  158.   : "r" (a6), "r" (a0)
  159.   : "a0","a1","d0","d1");
  160.   *(char *)a0 = *(char *)a0;
  161. }
  162. static __inline void 
  163. EndUpdate (BASE_PAR_DECL struct Layer *layer,unsigned long flag)
  164. {
  165.   BASE_EXT_DECL
  166.   register struct LayersBase* a6 __asm("a6") = BASE_NAME;
  167.   register struct Layer *a0 __asm("a0") = layer;
  168.   register unsigned long d0 __asm("d0") = flag;
  169.   __asm __volatile ("jsr a6@(-0x54)"
  170.   : /* no output */
  171.   : "r" (a6), "r" (a0), "r" (d0)
  172.   : "a0","a1","d0","d1");
  173.   *(char *)a0 = *(char *)a0;
  174. }
  175. static __inline LONG 
  176. FattenLayerInfo (BASE_PAR_DECL struct Layer_Info *li)
  177. {
  178.   BASE_EXT_DECL
  179.   register LONG  _res  __asm("d0");
  180.   register struct LayersBase* a6 __asm("a6") = BASE_NAME;
  181.   register struct Layer_Info *a0 __asm("a0") = li;
  182.   __asm __volatile ("jsr a6@(-0x9c)"
  183.   : "=r" (_res)
  184.   : "r" (a6), "r" (a0)
  185.   : "a0","a1","d0","d1");
  186.   *(char *)a0 = *(char *)a0;
  187.   return _res;
  188. }
  189. static __inline void 
  190. InitLayers (BASE_PAR_DECL struct Layer_Info *li)
  191. {
  192.   BASE_EXT_DECL
  193.   register struct LayersBase* a6 __asm("a6") = BASE_NAME;
  194.   register struct Layer_Info *a0 __asm("a0") = li;
  195.   __asm __volatile ("jsr a6@(-0x1e)"
  196.   : /* no output */
  197.   : "r" (a6), "r" (a0)
  198.   : "a0","a1","d0","d1");
  199.   *(char *)a0 = *(char *)a0;
  200. }
  201. static __inline struct Region *
  202. InstallClipRegion (BASE_PAR_DECL struct Layer *layer,struct Region *region)
  203. {
  204.   BASE_EXT_DECL
  205.   register struct Region * _res  __asm("d0");
  206.   register struct LayersBase* a6 __asm("a6") = BASE_NAME;
  207.   register struct Layer *a0 __asm("a0") = layer;
  208.   register struct Region *a1 __asm("a1") = region;
  209.   __asm __volatile ("jsr a6@(-0xae)"
  210.   : "=r" (_res)
  211.   : "r" (a6), "r" (a0), "r" (a1)
  212.   : "a0","a1","d0","d1");
  213.   *(char *)a0 = *(char *)a0;  *(char *)a1 = *(char *)a1;
  214.   return _res;
  215. }
  216. static __inline struct Hook *
  217. InstallLayerHook (BASE_PAR_DECL struct Layer *layer,struct Hook *hook)
  218. {
  219.   BASE_EXT_DECL
  220.   register struct Hook * _res  __asm("d0");
  221.   register struct LayersBase* a6 __asm("a6") = BASE_NAME;
  222.   register struct Layer *a0 __asm("a0") = layer;
  223.   register struct Hook *a1 __asm("a1") = hook;
  224.   __asm __volatile ("jsr a6@(-0xcc)"
  225.   : "=r" (_res)
  226.   : "r" (a6), "r" (a0), "r" (a1)
  227.   : "a0","a1","d0","d1");
  228.   *(char *)a0 = *(char *)a0;  *(char *)a1 = *(char *)a1;
  229.   return _res;
  230. }
  231. static __inline void 
  232. LockLayer (BASE_PAR_DECL long dummy,struct Layer *layer)
  233. {
  234.   BASE_EXT_DECL
  235.   register struct LayersBase* a6 __asm("a6") = BASE_NAME;
  236.   register long a0 __asm("a0") = dummy;
  237.   register struct Layer *a1 __asm("a1") = layer;
  238.   __asm __volatile ("jsr a6@(-0x60)"
  239.   : /* no output */
  240.   : "r" (a6), "r" (a0), "r" (a1)
  241.   : "a0","a1","d0","d1");
  242.   *(char *)a0 = *(char *)a0;  *(char *)a1 = *(char *)a1;
  243. }
  244. static __inline void 
  245. LockLayerInfo (BASE_PAR_DECL struct Layer_Info *li)
  246. {
  247.   BASE_EXT_DECL
  248.   register struct LayersBase* a6 __asm("a6") = BASE_NAME;
  249.   register struct Layer_Info *a0 __asm("a0") = li;
  250.   __asm __volatile ("jsr a6@(-0x78)"
  251.   : /* no output */
  252.   : "r" (a6), "r" (a0)
  253.   : "a0","a1","d0","d1");
  254.   *(char *)a0 = *(char *)a0;
  255. }
  256. static __inline void 
  257. LockLayers (BASE_PAR_DECL struct Layer_Info *li)
  258. {
  259.   BASE_EXT_DECL
  260.   register struct LayersBase* a6 __asm("a6") = BASE_NAME;
  261.   register struct Layer_Info *a0 __asm("a0") = li;
  262.   __asm __volatile ("jsr a6@(-0x6c)"
  263.   : /* no output */
  264.   : "r" (a6), "r" (a0)
  265.   : "a0","a1","d0","d1");
  266.   *(char *)a0 = *(char *)a0;
  267. }
  268. static __inline LONG 
  269. MoveLayer (BASE_PAR_DECL long dummy,struct Layer *layer,long dx,long dy)
  270. {
  271.   BASE_EXT_DECL
  272.   register LONG  _res  __asm("d0");
  273.   register struct LayersBase* a6 __asm("a6") = BASE_NAME;
  274.   register long a0 __asm("a0") = dummy;
  275.   register struct Layer *a1 __asm("a1") = layer;
  276.   register long d0 __asm("d0") = dx;
  277.   register long d1 __asm("d1") = dy;
  278.   __asm __volatile ("jsr a6@(-0x3c)"
  279.   : "=r" (_res)
  280.   : "r" (a6), "r" (a0), "r" (a1), "r" (d0), "r" (d1)
  281.   : "a0","a1","d0","d1");
  282.   *(char *)a0 = *(char *)a0;  *(char *)a1 = *(char *)a1;
  283.   return _res;
  284. }
  285. static __inline LONG 
  286. MoveLayerInFrontOf (BASE_PAR_DECL struct Layer *layer_to_move,struct Layer *other_layer)
  287. {
  288.   BASE_EXT_DECL
  289.   register LONG  _res  __asm("d0");
  290.   register struct LayersBase* a6 __asm("a6") = BASE_NAME;
  291.   register struct Layer *a0 __asm("a0") = layer_to_move;
  292.   register struct Layer *a1 __asm("a1") = other_layer;
  293.   __asm __volatile ("jsr a6@(-0xa8)"
  294.   : "=r" (_res)
  295.   : "r" (a6), "r" (a0), "r" (a1)
  296.   : "a0","a1","d0","d1");
  297.   *(char *)a0 = *(char *)a0;  *(char *)a1 = *(char *)a1;
  298.   return _res;
  299. }
  300. static __inline LONG 
  301. MoveSizeLayer (BASE_PAR_DECL struct Layer *layer,long dx,long dy,long dw,long dh)
  302. {
  303.   BASE_EXT_DECL
  304.   register LONG  _res  __asm("d0");
  305.   register struct LayersBase* a6 __asm("a6") = BASE_NAME;
  306.   register struct Layer *a0 __asm("a0") = layer;
  307.   register long d0 __asm("d0") = dx;
  308.   register long d1 __asm("d1") = dy;
  309.   register long d2 __asm("d2") = dw;
  310.   register long d3 __asm("d3") = dh;
  311.   __asm __volatile ("jsr a6@(-0xb4)"
  312.   : "=r" (_res)
  313.   : "r" (a6), "r" (a0), "r" (d0), "r" (d1), "r" (d2), "r" (d3)
  314.   : "a0","a1","d0","d1","d2","d3");
  315.   *(char *)a0 = *(char *)a0;
  316.   return _res;
  317. }
  318. static __inline struct Layer_Info *
  319. NewLayerInfo (BASE_PAR_DECL0)
  320. {
  321.   BASE_EXT_DECL
  322.   register struct Layer_Info * _res  __asm("d0");
  323.   register struct LayersBase* a6 __asm("a6") = BASE_NAME;
  324.   __asm __volatile ("jsr a6@(-0x90)"
  325.   : "=r" (_res)
  326.   : "r" (a6)
  327.   : "a0","a1","d0","d1");
  328.   return _res;
  329. }
  330. static __inline void 
  331. ScrollLayer (BASE_PAR_DECL long dummy,struct Layer *layer,long dx,long dy)
  332. {
  333.   BASE_EXT_DECL
  334.   register struct LayersBase* a6 __asm("a6") = BASE_NAME;
  335.   register long a0 __asm("a0") = dummy;
  336.   register struct Layer *a1 __asm("a1") = layer;
  337.   register long d0 __asm("d0") = dx;
  338.   register long d1 __asm("d1") = dy;
  339.   __asm __volatile ("jsr a6@(-0x48)"
  340.   : /* no output */
  341.   : "r" (a6), "r" (a0), "r" (a1), "r" (d0), "r" (d1)
  342.   : "a0","a1","d0","d1");
  343.   *(char *)a0 = *(char *)a0;  *(char *)a1 = *(char *)a1;
  344. }
  345. static __inline LONG 
  346. SizeLayer (BASE_PAR_DECL long dummy,struct Layer *layer,long dx,long dy)
  347. {
  348.   BASE_EXT_DECL
  349.   register LONG  _res  __asm("d0");
  350.   register struct LayersBase* a6 __asm("a6") = BASE_NAME;
  351.   register long a0 __asm("a0") = dummy;
  352.   register struct Layer *a1 __asm("a1") = layer;
  353.   register long d0 __asm("d0") = dx;
  354.   register long d1 __asm("d1") = dy;
  355.   __asm __volatile ("jsr a6@(-0x42)"
  356.   : "=r" (_res)
  357.   : "r" (a6), "r" (a0), "r" (a1), "r" (d0), "r" (d1)
  358.   : "a0","a1","d0","d1");
  359.   *(char *)a0 = *(char *)a0;  *(char *)a1 = *(char *)a1;
  360.   return _res;
  361. }
  362. static __inline void 
  363. SwapBitsRastPortClipRect (BASE_PAR_DECL struct RastPort *rp,struct ClipRect *cr)
  364. {
  365.   BASE_EXT_DECL
  366.   register struct LayersBase* a6 __asm("a6") = BASE_NAME;
  367.   register struct RastPort *a0 __asm("a0") = rp;
  368.   register struct ClipRect *a1 __asm("a1") = cr;
  369.   __asm __volatile ("jsr a6@(-0x7e)"
  370.   : /* no output */
  371.   : "r" (a6), "r" (a0), "r" (a1)
  372.   : "a0","a1","d0","d1");
  373.   *(char *)a0 = *(char *)a0;  *(char *)a1 = *(char *)a1;
  374. }
  375. static __inline void 
  376. ThinLayerInfo (BASE_PAR_DECL struct Layer_Info *li)
  377. {
  378.   BASE_EXT_DECL
  379.   register struct LayersBase* a6 __asm("a6") = BASE_NAME;
  380.   register struct Layer_Info *a0 __asm("a0") = li;
  381.   __asm __volatile ("jsr a6@(-0xa2)"
  382.   : /* no output */
  383.   : "r" (a6), "r" (a0)
  384.   : "a0","a1","d0","d1");
  385.   *(char *)a0 = *(char *)a0;
  386. }
  387. static __inline void 
  388. UnlockLayer (BASE_PAR_DECL struct Layer *layer)
  389. {
  390.   BASE_EXT_DECL
  391.   register struct LayersBase* a6 __asm("a6") = BASE_NAME;
  392.   register struct Layer *a0 __asm("a0") = layer;
  393.   __asm __volatile ("jsr a6@(-0x66)"
  394.   : /* no output */
  395.   : "r" (a6), "r" (a0)
  396.   : "a0","a1","d0","d1");
  397.   *(char *)a0 = *(char *)a0;
  398. }
  399. static __inline void 
  400. UnlockLayerInfo (BASE_PAR_DECL struct Layer_Info *li)
  401. {
  402.   BASE_EXT_DECL
  403.   register struct LayersBase* a6 __asm("a6") = BASE_NAME;
  404.   register struct Layer_Info *a0 __asm("a0") = li;
  405.   __asm __volatile ("jsr a6@(-0x8a)"
  406.   : /* no output */
  407.   : "r" (a6), "r" (a0)
  408.   : "a0","a1","d0","d1");
  409.   *(char *)a0 = *(char *)a0;
  410. }
  411. static __inline void 
  412. UnlockLayers (BASE_PAR_DECL struct Layer_Info *li)
  413. {
  414.   BASE_EXT_DECL
  415.   register struct LayersBase* a6 __asm("a6") = BASE_NAME;
  416.   register struct Layer_Info *a0 __asm("a0") = li;
  417.   __asm __volatile ("jsr a6@(-0x72)"
  418.   : /* no output */
  419.   : "r" (a6), "r" (a0)
  420.   : "a0","a1","d0","d1");
  421.   *(char *)a0 = *(char *)a0;
  422. }
  423. static __inline LONG 
  424. UpfrontLayer (BASE_PAR_DECL long dummy,struct Layer *layer)
  425. {
  426.   BASE_EXT_DECL
  427.   register LONG  _res  __asm("d0");
  428.   register struct LayersBase* a6 __asm("a6") = BASE_NAME;
  429.   register long a0 __asm("a0") = dummy;
  430.   register struct Layer *a1 __asm("a1") = layer;
  431.   __asm __volatile ("jsr a6@(-0x30)"
  432.   : "=r" (_res)
  433.   : "r" (a6), "r" (a0), "r" (a1)
  434.   : "a0","a1","d0","d1");
  435.   *(char *)a0 = *(char *)a0;  *(char *)a1 = *(char *)a1;
  436.   return _res;
  437. }
  438. static __inline struct Layer *
  439. WhichLayer (BASE_PAR_DECL struct Layer_Info *li,long x,long y)
  440. {
  441.   BASE_EXT_DECL
  442.   register struct Layer * _res  __asm("d0");
  443.   register struct LayersBase* a6 __asm("a6") = BASE_NAME;
  444.   register struct Layer_Info *a0 __asm("a0") = li;
  445.   register long d0 __asm("d0") = x;
  446.   register long d1 __asm("d1") = y;
  447.   __asm __volatile ("jsr a6@(-0x84)"
  448.   : "=r" (_res)
  449.   : "r" (a6), "r" (a0), "r" (d0), "r" (d1)
  450.   : "a0","a1","d0","d1");
  451.   *(char *)a0 = *(char *)a0;
  452.   return _res;
  453. }
  454. #undef BASE_EXT_DECL
  455. #undef BASE_PAR_DECL
  456. #undef BASE_PAR_DECL0
  457. #undef BASE_NAME
  458.  
  459. __END_DECLS
  460.  
  461. #endif /* _INLINE_LAYERS_H */
  462.